<template>
    <div style="background:#f5f5f5;">
      <home-header></home-header>
      <master-swiper :swiperData='swiperData'></master-swiper>
      <home-icons :IconData='IconData'></home-icons>
      <preferential></preferential>
      <week-hot :WeekHotData='WeekHotData'></week-hot>
      <like-list></like-list>
    </div>
</template>

<script>
import HomeHeader from './components/Header'
import MasterSwiper from './components/Swiper'
import HomeIcons from './components/Icons'
import Preferential from './components/Preferential'
import WeekHot from './components/WeekHot'
import LikeList from './components/LikeList'
export default {
  name: 'Home',
  components: {
    HomeHeader,
    MasterSwiper,
    HomeIcons,
    Preferential,
    WeekHot,
    LikeList
  },
  data () {
    return {
      swiperData: [],
      IconData: [],
      PreferentialData: [],
      WeekHotData: [],
      LikeListData: []
    }
  },
  mounted: function () {
    this.$axios.get('/api/index.json')
      .then(res => {
        if (res.status === 200) {
          const result = res.data
          this.swiperData = result.data.swiperList
          this.IconData = result.data.iconList
          this.WeekHotData = result.data.weekHotList
        }
      })
  }
}
</script>
